package com.easy.admin.system.controller;

import io.itit.itf.okhttp.FastHttpClient;
import io.itit.itf.okhttp.callback.StringCallback;
import okhttp3.Call;

public class TestController {

    public static void main(String[] args)throws Exception {
        String url = "http://www.baidu.com";
        String result = testFastHttp(url);
        System.out.println(result);
    }

    public static String testFastHttp(String url) throws Exception{
       return FastHttpClient.get().url(url).build().execute().getResponse().body().toString();

        /*FastHttpClient.get().url("https://www.baidu.com").build().
                executeAsync(new StringCallback() {
                    @Override
                    public void onFailure(Call call, Exception e, int id) {
                      //  logger.error(e.getMessage(),e);
                    }
                    @Override
                    public void onSuccess(Call call, String response, int id) {
                        //logger.info("response:{}",response);
                       return response;
                    }
                });*/
    }

}
